package com.ya.jedis.client;

import com.ya.jedis.command.Command;
import com.ya.jedis.connection.Connection;

public class Client {

    private Connection connection;

    public Client(String host, int port){
        connection = new Connection(host, port);
        connection.connect();
    }

    public String set(String key, String value){
        connection.sendCommand(Command.SET, key.getBytes(), value.getBytes());
        return connection.replyCode();
    }

    public String get(String key){
        connection.sendCommand(Command.GET, key.getBytes());
        return connection.replyCode();
    }
    public String strLen(String key){
        connection.sendCommand(Command.STRINGLEN, key.getBytes());
        return connection.replyCode();
    }

}
